
export interface IRequestData<T> {
    cmd: T
    seq: number;
    data: any;
}

export interface IResponseData<T> {
    cmd: T;
    seq: number;
    data: any;
}

export interface IHanderResponse<T> {
    isResponse: boolean;
    data?: any
    tranfers?: Transferable[];
}

export interface IHanderMessage<T> {
    isResponse: boolean;
    resp: IResponseData<T>
    tranfers?: Transferable[];
}

export interface IWorkerImpl<T> {
    initWorker(self: Worker, context: any, data?: any): void;
    handleWork(context: any, cmd: T, data: any): Promise<IHanderResponse<T>>;
}